package itheima.d03;

import java.util.HashSet;

public class SetTest1 {
    public static void main(String[] args) {
        HashSet<Student> set = new HashSet<>();
        Student s1 = new Student("小王", 18, "男");
        Student s2 = new Student("小王", 18, "男");
        Student s3 = new Student("小王", 18, "男");
        Student s4 = new Student("小王", 18, "男");


        System.out.println(s1.hashCode()+" "+s1.hashCode()%16);
        System.out.println(s2.hashCode()+ " " +s2.hashCode()%16);

        System.out.println(s1.equals(s2));

        set.add(s1);
        set.add(s2);
        set.add(s3);
        set.add(s4);

        set.forEach(System.out::println);


    }

}
